<% @page_title=@talk.topic %>
<div style="font-size: 18pt;margin-bottom: 6px;padding-bottom: 6px;">
    <%if @user_talk.star == 1 %>
    <%= link_to image_tag("16-star-hot_16x16.png", :border=>0), :action => :change_star_show, :id => @user_talk.id %>
    <%else %>
    <%= link_to image_tag("16-star-cold_16x16.png", :border=>0), :action => :change_star_show, :id => @user_talk.id %>
    <%end %>
    <%=h @talk.topic %>
</div>
<div id="sidebar">
    	<%=image_tag("Trigger_16x16.gif") %><b>Talkers:</b>
    <% @talk.normal_talkers.each  do |talker| %>
    <p>
        <%= link_to talker.fullname, :controller => 'user', :action => 'show', :id => talker.id %>
        <% if talker.fullname %>
        <%=image_tag("online_16x16.png") %><% end %>
    </p>
    <% end %>
	<%if @talk.quit_talkers.empty? %>
	<% else %>
	<b>Talkers who quited:</b>
    <% @talk.quit_talkers.each  do |talker| %>
    <p>
        <%= link_to talker.fullname, :controller => 'user', :action => 'show', :id => talker.id %>
        <% if talker.fullname %>
        <%=image_tag("online_16x16.png") %><% end %>
    </p>
    <% end %><% end %>
        <%=image_tag("Trigger_16x16.gif") %><b><%= link_to 'Invite(not ready)', new_invitation_path %></b>
		<% @talk.send_invitations.each  do |invitation| %>
		<p>
        <%= link_to invitation.user.fullname, :controller => 'user', :action => 'show', :id => invitation.user.id %>
		 has invited <%= invitation.recipient_email %>
        </p>
		<% end %>
        <%=image_tag("Trigger_16x16.gif") %><%= link_to "Email History", {:action => 'email_talk_history', :id => @talk.id}, 
				:confirm => "Send Talk History to #{@user.email} by email?"%>
        <%=image_tag("Trigger_16x16.gif") %><b>Setting:(not ready)</b>
		<%=image_tag("Trigger_16x16.gif") %><%= link_to "Quit a talk", {:action => 'quit_talk', :id => @talk.id}, 
				:confirm => "Are You Sure to Quit This Talk?"%>
</div>



<div id="talkees" style="width:600px">
	<div id="talk" class="talkee_cell">
		<div class="talkee_face">
			<br>			
			<%= last_updater(@talk.latest_update_by) %><br>
			<span style="font-size:8pt;"><%= friendly_date(@talk.created_at) %></span>
		</div>
		<div class="talkee_container">
			<div id="talk_body">
				<br>
				<%= simple_format @talk.body %>
			</div>
			<div class="talkee_footer">
		        <%= link_to_function(image_tag("talkee_reply.png", :alt=>"Reply this talk", :border=>0), "Element.toggle('new_talkee')") %>
		        <% if (@talk.created_by == @user.id) %>
		        <%= link_to_function(image_tag("talkee_edit.png", :alt=>"Edit this talk", :border=>0),"Element.toggle('update_talk_body')") %>
		        <% end %>
			</div>
			<div id="new_talkee" style="display:none;">
        		<% form_remote_tag :url => {:action => 'new_talkee', :talk_id => @talk.id},:html => {:id => 'new_talkee_form'} do %>
            	<%= text_area 'talkee', 'body', :size => '50x5'  %>
	         	<%= submit_tag 'Reply', :class => "submit" %>
        		<% end %>
    		</div>		
			<div id="update_talk_body" style="display:none;">
				<% form_remote_tag :url => {:action => 'update_talk_body', :talk_id => @talk.id},:html => {:id => "update_talk_form", :method => :post} do %>
	        		<%= text_area :talk, :body, :value => @talk.body,  :size => '50x5' %><br>
	        		<%= submit_tag 'Update', :class => "submit" %>
	    		<% end %>
			</div>		
		</div>

		<br class="clearfloat" />
	</div>		

	<%= render(:partial => 'talkee', :collection => @talkees) %>
	
</div>

